<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <!--    <script src="http://code.jquery.com/jquery-2.1.1.min.js"/>-->

<!--    <script src="WEB-INF/pages/jquery-3.7.1.min.js"></script>-->
</head>
<body>


<h1>66666</h1>
<a href="https://www.baidu.com" id="aid">百度</a>


<form id="form_id"></form>

<script>

    $("#aid").click(function () {
        // console.log($(this));

        // console.log(this.href);

        // console.log($("#form_id").attr('action'));

        $("#form_id").attr('action', this.href);
        // console.log($("#form_id").attr('action'));

        $("#form_id").submit();
        return false;
    })


    // let $a = $("#aid");
    // console.log($a);
    // console.log($a.attr('href'));

    // $a.attr('href','https://www.jd.com');


</script>


</body>
</html>